<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
</head>
<body>
<h1>用户登录</h1>
<form  th:action="@{/login}" method="post">
    <p>
        <label for="username">用户名：</label>
        <input type="text" name="username" id="username">
    </p>
    <p>
        <label for="password">密码：</label>
        <input type="password" name="password" id="password">
    </p>
    <!--<button type="button" onclick="dologin()">登录</button>-->
    <button>登录</button>
</form>
<script type="text/javascript" src="/js/jquery-3.6.0.min.js"></script>
<script type="text/javascript">
    /*function dologin() {
        var username = $.trim($('#username').val());
        var password = $.trim($('#password').val());
        $.post('/doLogin', {username: username, password: password}, function (res) {
            alert(res.msg);
            if (res.code == 1) {
                window.location.href = '/';
            }
        }, 'json');
    }*/
</script>
</body>
</html>